least common multiple using prime factorization